home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / r / real_3d / real3dv3.3b.dms / real3dv3.3b.adf / RPL.LZH / RPL / framecmd.rpl < prev    next >
Text File  |  1995-05-04  |  2KB  |  48 lines

  1.  
  2. ( ----------------------------------------------------------------------
  3. ( Frame Command examples
  4. ( To try any of these, add the following line to your r3d3:s/rpl-startup:
  5. ( "r3d3:rpl/framecmd.rpl" LOAD
  6. ( ----------------------------------------------------------------------
  7.  
  8. 256 STRING sFileName
  9. 256 STRING sTmp
  10.  
  11. ( Asks if the user wants to cancel the animation
  12. ( -----------------------------------------------
  13.  
  14. : FcAskUser
  15.     "CONTINUE|CANCEL" "Frame Rendered" GET_KEY
  16.     NOT IF
  17.         "User Break" ERROR
  18.     ENDIF
  19. ;
  20.  
  21. ( This converts image file rendered by given View window to jpeg file 
  22. ( by using the public domain program 'cjpeg' and deletes the original file.
  23. ( Takes one parameter which is the name of the View window used for
  24. ( rendering to a file. Note that 'cjpeg' understands only Targa or PPM.
  25. ( 'cjpeg' program is is based in part on the work of the Independent 
  26. ( JPEG Group. 'cjpeg' is included in 'Accessories' drawer of the Real 3D
  27. ( installation. 
  28. ( -----------------------------------------------------------------------
  29.  
  30. : FcCompress
  31.     ( build up string 'W:Viewname->filename' for attr()
  32.     "attr(W:%s->filename)" sTmp SPRINTF 
  33.  
  34.     ( create actual file name
  35.     sTmp EVAL                   ( filename in given View window
  36.     "attr(A:->currentfrm)" EVAL ( current frame
  37.     "attr(A:->format)" EVAL     ( format string 
  38.     sFileName SPRINTF
  39.  
  40.     ( convert file
  41.     sFileName sFileName "r3d3:accessories/cjpeg -q 80 %s %s.jpg" sTmp SPRINTF
  42.     sTmp SYSTEM
  43.  
  44.     ( delete file
  45.     sFileName "delete %s" sTmp SPRINTF
  46.     sTmp SYSTEM
  47. ;
  48.